<template>
  <div>
<van-tabbar v-model="active" active-color="#124eb1">
  <van-tabbar-item icon="home-o"  to="/">首页</van-tabbar-item>
  <van-tabbar-item icon="friends-o"  to="/mine">我的</van-tabbar-item>
</van-tabbar>
  </div>
</template>
<script>
export default {
  data() {
    return {
      active: ''
    }
  },
    watch: {
    $route(to, from) {
      console.log(to);
       if(to.name=='Index'){
         this.active=0
       }
       else if(to.name=='Mine'){
         this.active=1
       }else{
         this.active=''
       }
    },
  },
}
</script>
